import http from "./http";

// 修改用户电话号码
export const revisePhone = (phone) => {
  return http.request({
    url: "/user/update",
    method: "POST",
    data: {
      phone: phone,
    },
  });
};

// 修改密码
export const alterPassWord = (data) => {
  return http.request({
    url: "/user/update-password",
    method: "POST",
    data: {
      oldPassWord: data.oldPassWord,
      newPassWord: data.newpassWord,
    },
  });
};
//绑定用户微信
export const WXBinding = (data) => {
  return http.request({
    url: `/wx/bind-openid?code=${data}`,
    method: "POST",
  });
};
// 解绑用户微信
export const unBinding = () => {
  return http.request({
    url: `/wx/unbind-openid`,
    method: "POST",
  });
};
// 更换邮箱
export const AlterEmail = (data) => {
  return http.request({
    url: `/user/update-email`,
    method: "POST",
    data: {
      email: data.email,
      code: data.code,
    },
  });
};
